
<header id="webHeader">
	<div class="left-section mb">
		<a  href="/admin/app/index"><h1>{$__settings[admin_title]}</h1></a>
	</div>
	<nav class="right-section">
		<ul class="fl nav-top" id="topNav">
			<li data-id="mpe">
				<a href="{url /admin/mpe/index}"  class="mch">MPE管理</a>
			</li>
			<li data-id="offer">
				<a href="{url /admin/offer/grade_index}"  class="mch">报价工具</a>
			</li>
			<li data-id="quote">
				<a href="{url /admin/quote/trend}"  class="mch">行情工具</a>
			</li>
			<li data-id="kzmb">
				<a href="{url /admin/user/index}"  class="mch">控制面板</a>
			</li>
			<?php
		 		if(count($__sysmenus)==0){
           			echo "<br>";
				}
			?>
		</ul>
		<ul class="fr profile">
			<li class="dropdown">
				<a href="#" class="dropdown-toggle mch" data-toggle="dropdown" aria-expanded="false"><i class="user ib"></i>
					<span style="vertical-align: top;">您好，{$loginUser->getName()}</span><span class="caret"></span></a>
				<ul class="dropdown-menu user" role="menu">
					<li><a href="#" id="manager-profile"><i class="glyphicon glyphicon-user"></i> 个人资料</a></li>
					<li><a href="#" id="manager-pass"><i class="glyphicon glyphicon-edit"></i> 修改密码</a></li>
					<li><a href="/admin/login/logout"><i class="glyphicon glyphicon-off"></i> 退出登陆</a></li>
				</ul>
			</li>
		</ul>
	</nav>
</header>
<!-- top nav -->

<script type="text/html" id="manager-porfile-template">
	<form role="form" class="content-add-form form-horizontal" id="manager-porfile-form" autocomplete="off">

		<div class="form-group">
			<label class="col-sm-2 control-label"><span class="asterisk">*</span> 用户名</label>
			<div class="col-sm-10">
				<input type="text" class="form-control" value="{$loginUser->getUsername()}" readonly />
			</div>
		</div>

		<div class="form-group">
			<label class="col-sm-2 control-label"><span class="asterisk">*</span> 角色</label>
			<div class="col-sm-10">
				<input type="text" class="form-control" value="{expr $loginUser->getRoleName()?$loginUser->getRoleName():'超级管理员'}" readonly />
			</div>
		</div>

		<div class="form-group">
			<label class="col-sm-2 control-label"><span class="asterisk">*</span> 手机号码</label>
			<div class="col-sm-10">
				<input type="text" dtype="mobile" name="data[mobile]" value="{$loginUser->getMobile()}" class="form-control" placeholder="手机号码" required/>
				<p class="help-block"></p>
			</div>
		</div>

		<div class="form-group">
			<label class="col-sm-2 control-label"><span class="asterisk">*</span> 姓名</label>
			<div class="col-sm-10">
				<input type="text" name="data[name]" value="{$loginUser->getName()}" class="form-control" placeholder="姓名" maxlength="10" required/>
				<p class="help-block"></p>
			</div>
		</div>

		<div class="form-group">
			<label class="col-sm-2 control-label"><!--<span class="asterisk">*</span>--> 工号</label>
			<div class="col-sm-10">
				<input type="text" name="data[jobno]" value="{$loginUser->getJobno()}" dtype="number" class="form-control" maxlength="5" placeholder="工号" />
				<p class="help-block"></p>
			</div>
		</div>

		<div class="form-group">
			<label class="col-sm-2 control-label">邮箱</label>
			<div class="col-sm-10">
				<input type="text" name="data[email]" value="{$loginUser->getEmail()}" maxlength="30" class="form-control" placeholder="邮箱" />
				<p class="help-block"></p>
			</div>
		</div>

		<div class="form-group">
			<label class="col-sm-2 control-label"><span class="asterisk">*</span> 账户状态</label>
			<div class="col-sm-10">
				<div class="bootstrap-switch-swrap">
					<input type="checkbox" class="bswitch bswitch-list" data-size="mini" disabled {if $loginUser->getStatus()==1}checked{/if} data-on-text="正常" data-off-text="禁用">
				</div>
			</div>
		</div>

		<div class="form-group">
			<label class="col-sm-2 control-label">简介</label>
			<div class="col-sm-10">
				<textarea name="data[summary]" class="form-control" maxlength="100" placeholder="这里输入管理员简介">{$loginUser->getSummary()}</textarea>
				<p class="help-block"></p>
			</div>
		</div>

	</form>
</script>

<script type="text/html" id="manager-pass-template">
	<form role="form" class="content-add-form" id="manager-pass-form" autocomplete="off">

		<div class="form-element">
			<div class="form-group">
				<label><span class="asterisk">*</span> 新密码</label>
				<input type="password" name="password" class="form-control" id="password" handler="__checkPass__(value, ele)" min-length="6" maxlength="20" placeholder="新密码" required />
			</div>
			<p class="help-block">请输入6-20位的密码</p>
		</div>
		<div class="form-element">
			<div class="form-group">
				<label><span class="asterisk">*</span> 确认密码</label>
				<input type="password" dtype="repass" for-password="password" class="form-control" min-length="6" maxlength="20" placeholder="确认密码" required />
			</div>
			<p class="help-block">请输入6-20位的密码</p>
		</div>

	</form>
</script>

<script>
	function __checkPass__(value, ele) {
		if ( /^\d+$/.test(value) ) {
			$(ele).parent().next().addClass("text-error").html('密码不能为纯数字');
			ele.focus();
			return false;
		}
		if ( /^[a-z|a-z]+$/.test(value) ) {
			$(ele).parent().next().addClass("text-error").html('密码不能为纯字母');
			ele.focus();
			return false;
		}
		return true;
	}
</script>